package com.dzt.androidframework.jsoup.detail;

import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;

import com.dzt.androidframework.R;
import com.dzt.androidframework.activity.ActivityTitle;
import com.dzt.androidframework.jsoup.detail.adapter.GalleryPagerAdapter;
import com.dzt.androidframework.jsoup.detail.bean.ImageDetailDomain;

import org.xutils.view.annotation.ViewInject;

import java.util.ArrayList;

public class ImageGalleryActivity extends ActivityTitle {

	@ViewInject(R.id.viewpager)
	private ViewPager viewPager;
	private ArrayList<ImageDetailDomain> imageNewList;
	private PagerAdapter adapter;

	@Override
	protected int getLayoutId() {
		return R.layout.activity_image_gallery;
	}

	@Override
	protected void initParams() {
		String imageNewTitle = getIntent().getStringExtra("image_new_title");
		setTitleView(imageNewTitle);
		imageNewList = getIntent().getParcelableArrayListExtra("imageNewList");
		adapter = new GalleryPagerAdapter(ImageGalleryActivity.this, imageNewList);
		viewPager.setAdapter(adapter);
	}

	@Override
	protected void initData(Bundle savedInstanceState) {

	}

	@Override
	protected String[] initPermissions() {
		return new String[0];
	}
}
